﻿using Basic.FlowCollect;
using Basic.FlowRemoteModel.FlowAppMsg;
using Basic.FlowRemoteModel.FlowAppMsg.Model;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class FlowAppMsgEvent : IRpcApiService
    {
        private readonly IFlowAppMsgTemplateCollect _AppMsg;

        public FlowAppMsgEvent ( IFlowAppMsgTemplateCollect appMsg )
        {
            this._AppMsg = appMsg;
        }

        public FlowAppMsgDto[] GetFlowAppMsg ( GetFlowAppMsg obj )
        {
            return this._AppMsg.Gets<FlowAppMsgDto>(obj.AppId);
        }
        public void SetFlowAppMsg ( SetFlowAppMsg obj )
        {
            this._AppMsg.Sync(obj.AppId, obj.FormId, obj.Datum);
        }
    }
}
